import VueRouter from "vue-router";
import Vue from "vue";
import deviceHistory from '../components/deviceHistory.vue';
import deviceView from '../components/deviceView'
import deviceEchart from '../components/deviceEchart'
import patientEchart from '../components/patientEchart'
import template from '../components/template'
import mainView from '../components/mainView.vue'
import loginView from '../components/loginView.vue'
import inandoutHistory from '../components/inandoutHistory.vue';
import patientHistory from '../components/patientHistory.vue';


Vue.use(VueRouter)

// export default new VueRouter({
//     routes:[
//         {path:'/',redirect:"/show"},
//         {path:'/show',name:'show',component: BookView},
//         {path:'/history',name:'history',component: Table},
//         {path:'/echart',name:'echart',component: echart},
        
//     ]

// })
 

//要加入登入界面
//1.用第一个路由路径
//2.将App界面中的deviceView注释掉
//3.将mainView中注释掉的router-view标签打开
// export default new VueRouter({
//     routes:[
//         {path:'/',redirect:"/login"},
//         {path:'/login',name:'login',component: loginView ,meta: { keepAlive:  true}},
//         {path:'/main',name:'main',component: mainView ,meta: { keepAlive: true },children:[
//             {path:'/show',name:'show',component: deviceView,meta: { keepAlive: true }},
//             {path:'/history',name:'history',component: deviceHistory,meta: { keepAlive: true }},
//             {path:'/echart',name:'echart',component: deviceEchart,meta: { keepAlive: true }},
//             {path:'/more',name:'more',component: template,meta: { keepAlive: true }},
//         ]},
//         // {path:'/show',name:'show',component: deviceView},
//         // {path:'/history',name:'history',component: deviceHistory},
//         // {path:'/echart',name:'echart',component: deviceEchart},
//         // {path:'/more',name:'more',component: template},
        
//     ]

// })


export default new VueRouter({
    routes:[
        {path:'/',redirect:"/show"},
        {path:'/login',name:'login',component: loginView,meta: { keepAlive: true } },
        {path:'/show',name:'show',component: deviceView,meta: { keepAlive: true } },
        {path:'/history',name:'history',component: deviceHistory,meta: { keepAlive: true } },
        {path:'/history1',name:'history1',component: inandoutHistory,meta: { keepAlive: true } },
        {path:'/history2',name:'history2',component: patientHistory,meta: { keepAlive: true } },
        {path:'/echart',name:'echart',component: deviceEchart,meta: { keepAlive: true } },
        {path:'/echart1',name:'echart1',component: patientEchart,meta: { keepAlive: true } },
        {path:'/more',name:'more',component: template,meta: { keepAlive: true } },
        
    ]

})